 /**
 * 逻辑、功能相关描述: <br>
 *
 * @author 付湘辉  <br>
 * 编写日期：2008-12-15  <br>
 */
package com.ce.pms.custservice.dao.impl;

import java.util.List;

import org.hibernate.Query;

import com.ce.pms.base.dao.impl.PmsBaseDaoImpl;
import com.ce.pms.custservice.dao.IBillDao;
import com.ce.pms.custservice.model.BillDO;
import com.ce.util.BlankUtil;

/**
 * 	名称: com.ce.pms.custservice.dao.impl.BillDaoImpl <br>
 *  账单Dao实现类
 *
 * @author  付湘辉  <br>
 * Created on： 2008-12-15 <br>
 * @author <br>
 * update on： <br>
 * why: <br>
 */
public class BillDaoImpl extends PmsBaseDaoImpl<BillDO> implements IBillDao {
	/**
	 * 功能描述:根据派工单查询与其对应的账单Do  <br>
	 * @param dispatchFormId 派工单ID
	 * @return
	 *
	 * Create author:付湘辉 <br>
	 * Create on:2008-12-17  <br>
	 * Edit author:  <br>
	 * Edit on:    <br>
	 * Why:     <br>
	 */
	public BillDO getBillDOByDispatchFormId(Long dispatchFormId){
		String hql = "from BillDO bo where bo.theDispatchFormDO.id=? ";
		Query query = super.createQuery(hql, dispatchFormId);
		List list = query.list();
		if (BlankUtil.isBlank(list)) {
			return null;
		}
		return (BillDO)list.get(0);
	}

}
